﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace Triples {
    public class CardComparer : IEqualityComparer<ICard> {

        public bool Equals(ICard x, ICard y) {
            return GetHashCode(x) == GetHashCode(y);
        }

        public int GetHashCode(ICard card) {
            return BitConverter.ToInt32(new byte[] { 
                Convert.ToByte (card.Color), 
                Convert.ToByte (card.Number), 
                Convert.ToByte (card.Shade), 
                Convert.ToByte (card.Shape) }, 0);
        }
    }
}
